home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tech91.zip / TI788.ASC < prev    next >
Text File  |  1991-08-26  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                                NUMBER  :  788
  9.   VERSION  :  3.5
  10.        OS  :  DOS
  11.      DATE  :  August 26, 1991                          PAGE  :  1/2
  12.  
  13.     TITLE  :  Converting Numeric Data from Earlier Paradox Versions
  14.  
  15.  
  16.  
  17.  
  18.   One of the major improvements of Paradox 3.5 over earlier
  19.   versions of Paradox is the use of the Turbo C math library.  This
  20.   library provides greater precision and compatibility across other
  21.   products than the one used in earlier versions of Paradox.
  22.   However, this will cause some numeric and dollar values that were
  23.   entered using an earlier version of Paradox to be stored
  24.   differently in Paradox 3.5.
  25.  
  26.   Some symptoms of a number being stored or rounded differently are
  27.   LOCATE and ZOOM commands returning the message "No Match Found".
  28.   Other symptoms are Find or multi-table queries that link on a
  29.   numeric field that do not produce expected results.  Data entered
  30.   via keyboard into Paradox 3.5 should not exhibit these symptoms
  31.   (Because of the way computers store numbers, there will always be
  32.   occasional roundoff errors when manipulating numbers with many
  33.   decimal digits of precision.  Unfortunately, other methods of
  34.   representing numbers also have disadvantages.)
  35.  
  36.   You can round your numeric data in a uniform manner with one or
  37.   both of the following methods.  Both involve the translation of
  38.   the existing data to an alphanumeric value and the retranslation
  39.   back into a Paradox Numeric field.
  40.  
  41.   The first method is to export the existing Paradox file to an
  42.   ASCII file, then import the data back into Paradox 3.5.  This
  43.   method is appropriate if there are many tables or a table with
  44.   many fields to correct.  (See Paradox 3.5 Readme File for
  45.   complete instructions.)
  46.  
  47.   The second method is to run a short PAL script to correct the
  48.   numeric values in the table.  This method is more appropriate if
  49.   there are few tables with few fields to correct.  Use the script
  50.   editor to write the PAL script for the second method.
  51.  
  52.   From the Paradox Main menu choose {Scripts} {Editor} {Write} and
  53.   provide a new script name.  This script will correct Numeric
  54.   field values through the use of the NUMVAL and STRVAL functions.
  55.   Combined they perform similar steps as a complete export to ASCII
  56.   and import from ASCII.  In the script Replace TableName with the
  57.   name of the table and replace FieldName with the name of the
  58.   field to be corrected.  The Field to be corrected MUST be a
  59.   Numeric field.
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox                                NUMBER  :  788
  75.   VERSION  :  3.5
  76.        OS  :  DOS
  77.      DATE  :  August 26, 1991                          PAGE  :  2/2
  78.  
  79.     TITLE  :  Converting Numeric Data from Earlier Paradox Versions
  80.  
  81.  
  82.  
  83.  
  84.   ; Script Begins
  85.   COEDIT "TableName"
  86.   SCAN
  87.     IF NOT ISBLANK([FieldName])
  88.        THEN [FieldName] = NUMVAL(STRVAL([FieldName]))
  89.     ENDIF
  90.   ENDSCAN
  91.   DO_IT!
  92.   ; Script Ends
  93.  
  94.   It is possible to convert more than one field at a time.  Simply
  95.   insert additional lines inside the SCAN and ENDSCAN commands for
  96.   each field that need conversion.  So a script that converted two
  97.   fields would have lines that look like this (where both fields
  98.   MUST be Numeric):
  99.  
  100.   ; Script Begins
  101.   IF NOT ISBLANK([FieldName]) THEN
  102.   [FieldName] = NUMVAL(STRVAL([FieldName]))
  103.   ENDIF
  104.   IF NOT ISBLANK([FieldName 2]) THEN
  105.   [FieldName 2] = NUMVAL(STRVAL([FieldName 2]))
  106.   ENDIF
  107.   ; Script Ends
  108.  
  109.   Press <F2> to save this script.  To run the script choose
  110.   {Scripts} {Play} from the main menu and select your script.
  111.  
  112.   After performing either of these two methods, the values in will
  113.   appear on screen to be unchanged, yet a ZOOM, LOCATE, FIND query,
  114.   or linking query operation will now produce the desired results.
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.